<?php

include_once '../model/Category.php';
include_once '../util/database_conn.php';

$start = ($_REQUEST['start'] != '') ? $_REQUEST['start'] : 0;
$limit = ($_REQUEST['limit'] != '') ? $_REQUEST['limit'] : 5;

$total = count(Category::loadsAll());
echo "{success:true,total:" . $total . ",rows:" . Category::loadsForJSON($start,$limit) . "}";
mysql_close($conn);
?>
